<div style=" margin-top : 80px;"> 选择杯赛小组赛
<select name="select-league" id="select-league">
<?php foreach($this->cups as $cup){?>
  <option value ="<?php echo $cup['cup_id'] ?>"
          <?php if($this->actuel_cup_id ==$cup['cup_id']){
          	    echo 'selected="selected"';
          }?>><?php echo $cup['name'] ?></option>
 <?php }?>
</select>

</div>
<div style="text-align: center; font-weight:bold;margin-top: 30px;width:600px;font-size:24px;"><?php echo $this->actuel_cup_name;?></div>
<div style="text-align: center; width:600px;">(客场 : 主场)</div>
<div>
已完成比赛
<?php foreach ($this->finished_games as $group_name =>$group){
	if(!empty($group)){?>

<div> <?php echo $group_name?>组</div>
<?php foreach ($group as $game){?>
<div class="score" id="<?php echo $game['id'];?>">
<img class="logo_away" src="/images/team_logo/<?php echo $game['away_logo']?>"/>
<div class="away-team"><?php echo $game['away_team_name']?></div>
<div class="away-team-score"><?php echo $game['away_team_score'] ; ?></div>
<div class="home-team-score"><?php echo $game['home_team_score'] ; ?></div>
<div class="home-team"><?php echo $game['home_team_name']?></div>
<img class="logo_home" src="/images/team_logo/<?php echo $game['home_logo']?>"/>
<div class="confirm-game input-game ">修改比分</div>
</div>
<?php               }
        }
} ?>

</div>


<div>
待确认比赛
<?php foreach ($this->to_confirm_games as $group_name =>$group){
	if(!empty($group)){?>

<div> <?php echo $group_name?>组</div>
<?php foreach ($group as $game){?>
<div class="score" id="<?php echo $game['id'];?>">
<img class="logo_away" src="/images/team_logo/<?php echo $game['away_logo']?>"/>
<div class="away-team"><?php echo $game['away_team_name']?></div>
<div class="away-team-score"><?php echo $game['away_team_score'] ; ?></div>
<div class="home-team-score"><?php echo $game['home_team_score'] ; ?></div>
<div class="home-team"><?php echo $game['home_team_name']?></div>
<img class="logo_home" src="/images/team_logo/<?php echo $game['home_logo']?>"/>
<div class="confirm-game input-game " style="width : 50px;">修改比分</div>
<?php if ($game['home_team_confirm']=='yes'){?>
<div class="confirm-game" style="left : 670px;"><?php echo "待客队确认";?></div>
<?php }else{?>
<div class="confirm-game" style="left : 670px;"><?php echo "待主队确认";?></div>
<?php }?>

</div>
<?php }
}} ?>

</div>

<div>
待录入比赛
<?php foreach ($this->to_start_games as $group_name =>$group){
	if(!empty($group)){?>
<div> <?php echo $group_name?>组</div>
<?php foreach ($group as $game){?>
<div class="score" id="<?php echo $game['id'];?>">
<img class="logo_away" src="/images/team_logo/<?php echo $game['away_logo']?>"/>
<div class="away-team"><?php echo $game['away_team_name']?></div>
<div class="away-team-score"><?php echo $game['away_team_score'] ; ?></div>
<div class="home-team-score"><?php echo $game['home_team_score'] ; ?></div>
<div class="home-team"><?php echo $game['home_team_name']?></div>
<img class="logo_home" src="/images/team_logo/<?php echo $game['home_logo']?>"/>
<div class="confirm-game input-game " >录入比分</div>
</div>
<?php } 
}}?>

</div>



<div id="user-input-dialog">
    <form action="" method ="post">
    <div class="away-team"></div>
<div class="away-team-score"><input type="text" name="away_team_score"  value="" size="5" /> &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;</div>

<div class="home-team-score"><input type="text" name="home_team_score"  value="" size="5" /></div>
<div class="home-team"></div>
<input id="" class="button" type="submit" value="    确定    " style="margin-left : 100px" />
    </form>
</div>


<script type="text/javascript">
<!--//--><![CDATA[//><!--
$(document).ready(function() {
    $('#select-league').change(function(){
        window.location=window.location.pathname + '?cup_id='+$(this).val();

    }
    );


    $(".input-game").each(function(){                 
    	  $(this).click(function(){
    		  $('#user-input-dialog form').attr('action' , '/admin/cup-input-score/game-id/'+ $(this).parent().attr('id'));

    		  $('#user-input-dialog .away-team').html($(this).prev().prev().prev().prev().html());
    		  $('#user-input-dialog .away-team-score input').attr('value',$(this).prev().prev().prev().html());
    		  $('#user-input-dialog .home-team-score input').attr('value',$(this).prev().prev().html());
    		  $('#user-input-dialog .home-team').html($(this).prev().html());
    		  $('#user-input-dialog').bPopup();
        	   })
    });
    

})

//--><!]]>
</script>


         